//
//  MainTabBarViewController.m
//  我的测试
//
//  Created by eliot on 16/8/1.
//  Copyright © 2016年 aleven. All rights reserved.
//

#import "MainTabBarViewController.h"

@interface MainTabBarViewController ()<UINavigationControllerDelegate, UIGestureRecognizerDelegate>

@end

@implementation MainTabBarViewController

- (void)viewWillAppear:(BOOL)animated{
    
    
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    //设置全局导航栏的颜色,字体
 
    
    
    UIImageView *iv = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"添加"]];
    iv.frame = CGRectMake(self.tabBar.frame.size.width / 2.0 - 30, self.tabBar.frame.origin.y, 60, self.tabBar.frame.size.height);
    
    [self.view addSubview:iv];
    UIButton *bb = [UIButton buttonWithType:UIButtonTypeCustom];
    bb.frame = CGRectMake(self.tabBar.frame.size.width / 2.0 - 40, self.tabBar.frame.origin.y, 80, self.tabBar.frame.size.height);
    [self.view addSubview:bb];
    [bb addTarget:self action:@selector(clickAddBtn) forControlEvents:UIControlEventTouchUpInside];
    self.tabBarController.hidesBottomBarWhenPushed = YES;
    

    self.tabBarController.moreNavigationController.delegate  = self;

    
}

- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated{
    
    if (self.childViewControllers.count) { // 不是根控制器
        viewController.hidesBottomBarWhenPushed = YES;
    }
    
//    [super pushViewController:viewController animated:animated];
    
}

//导航控制器跳转完成的时候调用
- (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated{
    
//    if(viewController == self.viewControllers[0]) {
//        //显示根控制器
//        self.interactivePopGestureRecognizer.delegate = nil;
//        
//        self.interactivePopGestureRecognizer.enabled = NO;
//        
//        
//        
//        
//        
//    }else{
//        //不是显示根控制器
//        //实现滑动放回的功能
//        //清空系统的代理就能实现这个功能
//        // self.interactivePopGestureRecognizer.delegate = _popDelegate;
//        //viewController.hidesBottomBarWhenPushed = YES;
//       // self.interactivePopGestureRecognizer.enabled = YES;
//        
//        
//        
//        
//    }
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


/** 点击添加按钮*/
-(void)clickAddBtn {

   
}


@end
